<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>相册信息管理</title>
    <!-- Bootstrap -->
    <link href="/static/css/bootstrap.min.css" rel="stylesheet">
    <style>
      body{background-color:#eee;}
    </style>
  </head>
  <body>   
    <!-- 页面容器开始 -->
    <div class="container">
      <div class="row">
        <!--页面左侧主体开始-->
        <div class="col-md-12 text-center">
            <h2>相册信息管理</h2>
            <br>
            <a type="button" href="/upload" class="btn btn-primary btn-sm">发布信息</a>
            <a type="button" href="/" class="btn btn-primary btn-sm">返回首页</a>
            <br><br>
            <table class="table table-hover text-center">
              <tbody><tr>
                <th class="text-center">标题</th>
                <th class="text-center">图片</th>
                <th class="text-center">图片大小</th>
                <th class="text-center">发布时间</th>
                <th class="text-center">管理</th>
              </tr>
              <% picList.forEach((pic) => { %>
              <tr>
                <td><a href="/static/images/<%= pic.newFilename %>"><%= pic.title %></a></td>
                <td><img src="/static/images/<%= pic.newFilename %>" width="100"/></td>
                <td><%= (pic.size/1024).toFixed(2) %> kb</td>
                <td><%= pic.mtime %></td>
                <td>
                  <a type="button" href="/del?id=<%= pic._id %>" class="btn btn-danger btn-xs">删除</a>
                </td>
              </tr>
              <% }) %>
            </tbody></table>
        </div>
        <!--页面左侧主体开始-->
      </div>
    </div>
    <!-- 页面容器结束 -->
  </body>
</html>